<%--
    Document   : buscarEmpleado
    Created on : 01/07/2011, 09:26:26 AM
    Author     : electro
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="<%=request.getContextPath()%>/css/componentes.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery/jquery.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery/jquery.tablesorter.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery/jquery.tablesorter.pager.js"></script>

        <script type="text/javascript">
            function buscar(apellido){
                document.busquedaForm.campo.value = apellido;
                document.busquedaForm.action="evaluacion.do?method=buscarHistorial";
                document.busquedaForm.submit();
            }
                        $(function() {
                $("#tableOne")
                .tablesorter({
                    widthFixed: true,
                    widgets: ['zebra'],
                    headers: {
                        2: {sorter: false}
                    }
                })
                .tablesorterPager({container: $("#pager"),positionFixed: false});
            });
        </script>
    </head>
    <body>
        <form id="busquedaForm" name="busquedaForm" action="" method="post">
            <input type="hidden" name="campo" id="campo" value="">
            <table>
                    <tr>
                        <td align="center">
                            <table>
                                <tr>
                                    <td class="tituloJsp" height="35">
                                        Historial de Desempeño
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <table width="400px" class="tableToolBar1" border="1">
                                <tr>
                                    <td colspan="3" bgcolor="#D6E3F2" align="left" height="20px"><b>&nbsp;&nbsp;Búsqueda</b></td>
                                </tr>
                                <tr style="height: 35px">
                                    <td align="left" bgcolor="#F9F9F9">&nbsp;&nbsp;Nombre</td>
                                    <td align="left" bgcolor="#F9F9F9"><input id="txtNombre" value='<c:out value="${campo}"/>' class="mayusculas" /></td>
                                    <td align="left" bgcolor="#F9F9F9"><button type= "button" class="button" onclick='buscar(txtNombre.value,"evaluacion.do?method=buscarHistorial")'><img src="images/zoom.png" alt="" height="15px"/> Buscar</button></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
            <hr>
            <table>
                <tr>
                    <td>&nbsp;</td>
                </tr>
            </table>

            <table cellspacing="0" cellpadding="0" align="center" border="0" class="tableToolBar" width="700px">
                <tr bgcolor="#D6E3F2">
                    <td align="right">
                        <c:if test="${!empty lstUser}">
                            <div id="pager" class="pager">
                                <img alt="" src="<%=request.getContextPath()%>/images/jquery_table/first_old_2.png" class="first"/>
                                <img alt="" src="<%=request.getContextPath()%>/images/jquery_table/prev_old_2.png" class="prev"/>
                                <input type="text" class="pagedisplay selectSmall" style="text-align: center;width: 30px"/>
                                <img alt="" src="<%=request.getContextPath()%>/images/jquery_table/next_old_2.png" class="next"/>
                                <img alt="" src="<%=request.getContextPath()%>/images/jquery_table/last_old_2.png" class="last"/>
                                <select class="pagesize selectSmall">
                                    <option selected="selected" value="10">10</option>
                                    <option value="20">20</option>
                                    <option  value="30">30</option>
                                </select>
                            </div>
                        </c:if>
                    </td>
                </tr>
            </table>

            <c:if test="${!empty requestScope.lstUser}">
                <table id="tableOne" cellspacing="1" align="center" border="0" class="tablesorter" style="width: 700px" >
                    <thead>
                        <tr>
                            <th width="10%"><div align="center">Nombre</div></th>
                            <th width="12%"><div align="center">Puesto</div></th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="jbean" items="${lstUser}">
                            <tr>
                                <td align="left" >
                                    <a href="#" onclick="clickLink('<c:out value="${jbean.strIdEmpleado}" />')"><c:out value="${jbean.strNombreComp}" /></a>
                                </td>
                                <td align="left" ><c:out value="${jbean.strDescrip_Idp}" /></td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </c:if>
            <c:if test="${empty lstUser && presionoBuscar == 1}">
                <div align="center" class="label">NO SE ENCONTRARON REGISTROS</div><br>
            </c:if>
            </form>

            <script type="text/javascript">
                function clickLink(obj){
                    var url = '<%=request.getContextPath()%>/ConsultaAction.do?method=IrEvaluacionAnterior&id='+obj+'&var=3';
                    var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=900, height=800, top=15, left=15";
                    window.open(url,"",opciones);
                }
            </script>
    </body>
</html>